package org.example.test

import java.io.InputStream
import java.net.{ServerSocket, Socket}

/**
 * 服务端
 */
object Executor {
  def main(args: Array[String]): Unit = {
    val serverSocket:ServerSocket = new ServerSocket(9999)

    // 监听
    val socket: Socket = serverSocket.accept()

    val stream: InputStream = socket.getInputStream

    val result:Int = stream.read()

    println(result)

    stream.close()
    socket.close()

    serverSocket.close()
  }
}
